import allure
from appium.webdriver.common.appiumby import AppiumBy
from tests.app.pages.wecom import Wecom


class DeleteConfirmationPage(Wecom):
    __CONFIRMATION_DELETE_BUTTON = AppiumBy.XPATH, '//*[@text = "删除"]'

    @allure.step("点击确认删除按钮")
    def address_click_delete_button(self):
        from tests.app.pages.member_page import MemberPage
        self.find_and_click(self.__CONFIRMATION_DELETE_BUTTON)
        return MemberPage(self.driver)

    @allure.step("点击确认删除按钮")
    def chat_click_delete_button(self):
        from tests.app.pages.group_chat_setup_page import GroupChatSetupPage
        self.find_and_click(self.__CONFIRMATION_DELETE_BUTTON)
        return GroupChatSetupPage(self.driver)

    @allure.step("点击确认删除按钮")
    def work_bench_member_click_delete_button(self):
        from tests.app.pages.member_and_department_management_page import MemberAndDepartmentManagementPage
        self.find_and_click(self.__CONFIRMATION_DELETE_BUTTON)
        return MemberAndDepartmentManagementPage(self.driver)
